package com.lxp.jx.ui.home;

import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.lxp.jx.R;
import com.lxp.jx.listener.OnFragmentInteractionListener;
import com.orhanobut.logger.Logger;
import com.yonyou.integration.base.BaseFragment;


import butterknife.BindView;
import butterknife.OnClick;

public class PoetryFragment extends BaseFragment {
    @BindView(R.id.btn_article_t3)
    Button btnArticleT3;
    @BindView(R.id.btn_article_t4)
    Button btnArticleT4;
    private OnFragmentInteractionListener mListener;

    public static PoetryFragment newInstance(String param1, String param2) {
        PoetryFragment fragment = new PoetryFragment();
        Bundle args = new Bundle();
        args.putString(ARG_PARAM1, param1);
        args.putString(ARG_PARAM2, param2);
        fragment.setArguments(args);
        return fragment;
    }

    @OnClick({
            R.id.btn_article_t3,
            R.id.btn_article_t4
    })
    @Override
    public void widgetClick(View v) {
        switch (v.getId()) {
            case R.id.btn_article_t3:
                onButtonPressed(Uri.parse("3333"));
                break;
            case R.id.btn_article_t4:
                onButtonPressed(Uri.parse("444"));
                break;
        }
    }

    @Override
    public void initParms(Bundle parms) {

    }

    @Override
    public View bindView() {
        return null;
    }

    @Override
    public int bindLayout() {
        return R.layout.fragment_blank;
    }

    @Override
    public void initView(View view) {

    }

    @Override
    public void doBusiness() {
    }

    public void onButtonPressed(Uri uri) {
        if (mListener != null) {
            mListener.onFragmentInteraction(uri);
        }
    }

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        if (context instanceof OnFragmentInteractionListener) {
            mListener = (OnFragmentInteractionListener) context;
        } else {
            throw new RuntimeException(context.toString()
                    + " must implement OnFragmentInteractionListener");
        }
    }

    @Override
    public void onDetach() {
        super.onDetach();
        mListener = null;
    }
}
